package com.bw;

import com.alibaba.fastjson.JSON;
import com.bw.entity.Week;
import com.bw.service.WeekService;
import com.bw.service.impl.WeekServiceImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * Created by qpx on 2017/8/31.
 */
@SpringBootApplication(scanBasePackages={"com.bw.service","com.bw.config"})
@MapperScan(basePackages={"com.bw.dao"})
public class MainTest extends SpringBootServletInitializer{
    public static void main(String[] args) throws InterruptedException {
        SpringApplication.run(MainTest.class,args);
//        String[] config = {"classpath:spring/spring-mybatis.xml","classpath:spring/spring-dubbo.xml"};
//        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext(config);
//        WeekService weekService = classPathXmlApplicationContext.getBean(WeekServiceImpl.class);
//        List<Week> weeks = weekService.selectByAll();
//        System.out.println(JSON.toJSONString(weeks));
//        classPathXmlApplicationContext.start();
//        while (true){
//            TimeUnit.HOURS.sleep(1);
//        }

    }
}
